/* Copyright © 2010 LPRM
Universidade Federal do Espírito Santo - RNP-GT CWTools

This file is part of JoinUs!.

JoinUs! is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

JoinUs! is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with JoinUs!. If not, see <http://www.gnu.org/licenses/>. */
package com.isisufes.joinus.appserver;

import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;


public class are_you_still_there extends HttpServlet
{
    /**
     * 
     */
    private static final long serialVersionUID = 949019092390146770L;

    public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException
    {
        response.setContentType("text/plain");
        PrintWriter out = response.getWriter();

        try {
            PreparedStatement ps = DBConn.stmt("select * from communitytype");
            ResultSet rs = ps.executeQuery();
            rs.next();
            out.println(rs.getString("name"));
            rs.close();
            ps.close();
        } catch (Exception e) {
            out.println("error*");
            out.println(e.getMessage());
            e.printStackTrace();
        }
    }

    public void init(ServletConfig conf) throws ServletException
    {
        super.init(conf);
        DBConn.init();
        Auth.init();
    }

    public void destroy()
    {
        DBConn.destroy();
        super.destroy();
    }
}
